<!DOCTYPE html>
<html lang="en" id="html">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      var htmlObj = document.documentElement;
      var rem = htmlObj.clientWidth / 10;
      // rem root em 根元素的font-szie
      //   给html标签设置font-size
      htmlObj.style.fontSize = rem + "px";
    </script>
  </body>
</html>
